package com.wn.auth;

import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletResponse;

public class CookieUtil {

    public static  void  responseCookie(String token, HttpServletResponse response){
        Cookie cookie = new Cookie("token", token);
        //设置cookie的有效期
        cookie.setMaxAge(1800);
        cookie.setPath("/");
        //把cookie响应到浏览器上
        response.addCookie(cookie);
    }
}
